Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 4 - Image Compressor Components / Image Compressor Components Reference
Functions / Direct Functions


CDGetSimilarity

Your component receives the CDGetSimilarity request whenever an application calls the Image Compression Manager's GetSimilarity function. Your component compares the specified compressed image to a picture stored in a pixel map and returns a value indicating the relative similarity of the two images.

Note
The CDGetSimilarity function is optional. If your component doesn't support it, it should return the codecUnimpError result code.
pascal ComponentResult CDGetSimilarity (PixMapHandle src, 
                                    const Rect *srcRect,
                                    ImageDescriptionHandle desc, 
                                    Ptr data, 
                                    Fixed *similarity);
src
Contains a handle to the noncompressed image. The image is stored in a pixel map structure.
srcRect
Contains a pointer to a rectangle defining the portion of the image to compare to the compressed image.
desc
Contains a handle to the image description structure that defines the compressed image for the operation.
data
Contains a pointer to the compressed image data.
similarity
Contains a pointer to a field that is to receive the similarity value. Your component sets this field to reflect the relative similarity of the two images. Valid values range from 0 (key frame) to 1 (identical).
DESCRIPTION
If the source image has been temporally compressed and is not a key frame (that is, the image relies on other frames that are not available to your component at this time), your component should return a result value of paramErr.

Only decompressors receive this request.

RESULT CODES
noErr0No error
paramErr-50Invalid parameter specified
memFullErr-108Not enough memory available
codecUnimpError-8962Feature not implemented by this compressor

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help